<template>
  <div>
    <p>{{ sex === 0 ? "男" : "女" }}</p>
    <button @click="btn">切换</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      sex: 0,
    };
  },

  created() {},

  methods: {
    btn() {
      this.sex === 0 ? (this.sex = 1) : (this.sex = 0);
    },
  },
};
</script>

<style scoped lang='less'>
</style>
